package cn.yyljlyy.blog.admin;

import cn.yyljlyy.blog.admin.entity.User;
import cn.yyljlyy.blog.admin.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @function: cn.yyljlyy.blog.admin
 * @author: LiJian
 * @data: 2016年11月17日17：04.
 */
@Controller
@RequestMapping("/admin")
public class AdminCtrl {

    @Autowired
    private PermissionService permissionService;

    @RequestMapping("/")
    public String index(Model model){
        model.addAttribute("user",new User("admin","admin"));
        model.addAttribute("menu",permissionService.findAll());
        return "admin/index";
    }
}
